home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / inet / ien / ien-109 < prev    next >
Encoding:
Text File  |  1988-12-01  |  46.5 KB  |  1,609 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.                      HOW TO BUILD A GATEWAY
  29.  
  30.                        Virginia Strazisar
  31.  
  32.                             IEN #109
  33.  
  34.                          August 31, 1979
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.                         TABLE OF CONTENTS
  43.  
  44.  1.  Introduction...............................................1
  45.  
  46.  2.  Information Maintained by Gateways.........................1
  47.  
  48.  3.  Initialization.............................................3
  49.  
  50.  4.  Determining Connectivity to Networks.......................3
  51.  
  52.  5.  Determining Connectivity to Neighbors......................4
  53.  
  54.  6.  Exchanging Routing Information.............................4
  55.  
  56.  7.  Computing Routes...........................................5
  57.  
  58.  8.  Forwarding Traffic.........................................7
  59.  
  60.  9.  Non-Routing Gateways.......................................7
  61.  
  62. 10.  Adding New Neighbors and Networks..........................8
  63.  
  64. 11.  Communications with Hosts..................................9
  65.  
  66. 12.  Future Modifications......................................10
  67.  
  68. 13.  Packet Formats............................................11
  69.  
  70. 14.  Examples..................................................19
  71.  
  72. 15.  Tables and Variables......................................23
  73.  
  74. 16.  Events and Responses......................................25
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82. 1.  Introduction
  83.  
  84. This is a description of how to implement a gateway.  The gateway
  85. forwards internet traffic formatted as  described  in  IEN  #111,
  86. "Internet Protocol".  The gateway polls its attached networks and
  87. neighbor  gateways  to  determine  its connectivity to them, then
  88. exchanges this information with its neighbor gateways in order to
  89. compute routes to each network in the catenet.  When gateways  or
  90. network interfaces fail, the gateways compute alternate routes to
  91. the networks.
  92.  
  93. The  design  for  this  gateway  routing  strategy was originally
  94. presented  in  IEN  #30,  "Gateway  Routing,  An   Implementation
  95. Specification".   That  document  gives an overview of the design
  96. and explains some of the decisions made in designing this routing
  97. strategy.  Since IEN #30 was released, this routing strategy  has
  98. been  implemented  in  several  gateways.  During implementation,
  99. several modifications were made to  the  original  design,  thus,
  100. those  sections of IEN #30 covering the detailed specification of
  101. the design are obsolete and are replaced by this document.
  102.  
  103. 2.  Information Maintained by Gateways
  104.  
  105. Gateways must maintain information about  their  connectivity  to
  106. networks  and  other  gateways.  The functional description below
  107. explains how this information is obtained  and  modified  by  the
  108. gateways.   For  the purpose of explaining the gateway functions,
  109. this information is  organized  into  the  following  tables  and
  110. variables.
  111.  
  112. Number of Networks
  113.  
  114. The  number  of  networks for which the gateway maintains routing
  115. information and to which it can forward  packets.   The  gateways
  116. maintain  and  exchange  routing  information  indexed by network
  117. numbers.  Thus, the Number of Networks also  corresponds  to  the
  118. highest  numbered network to which the gateway can route traffic.
  119. (Network numbers are listed in IEN #117, "Assigned Numbers".)
  120.  
  121.  
  122. Number of Neighbors
  123.  
  124. The number of neighbor gateways with which the gateway  exchanges
  125. routing  information.   A  neighbor  gateway  of gateway X is any
  126. gateway that has an interface on the same network as  gateway  X.
  127. If  gateway  X  and  its  neighbor  have more than one network in
  128. common, then each neighbor gateway  interface  on  a  network  to
  129. which  gateway  X  is  attached  is  considered  to be a separate
  130. neighbor.
  131.  
  132.  
  133.  
  134.                               - 1 -
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142. Gateway Addresses
  143.  
  144. The address of the  gateway  on  each  network  to  which  it  is
  145. attached.
  146.  
  147. Neighbor Addresses
  148.  
  149. The addresses of the neighbor gateways.
  150.  
  151. Connectivity to Neighbors
  152.  
  153. A  vector  of  the status of connectivity between the gateway and
  154. each of its neighbor gateways.  The connectivity is determined by
  155. polling the neighbors.
  156.  
  157. Routing Updates
  158.  
  159. The routing updates that are sent to the neighbor gateways.  Each
  160. routing update contains the distance from  the  gateway  to  each
  161. network.  There is one routing update for each neighbor.
  162.  
  163. Distance Matrix
  164.  
  165. A  matrix  of  the  routing  updates  received  from  each of the
  166. neighbor gateways.  Routing updates contain the distance  from  a
  167. gateway to each network.
  168.  
  169. Minimum Distance Vector
  170.  
  171. A  vector  of  the minimum distance to each network.  Distance is
  172. measured in networks traversed;  a gateway  which  is  physically
  173. attached  to  a  network  is  zero hops from that network; if the
  174. gateway must send through one other gateway to get to a  network,
  175. then it is one hop from that network.
  176.  
  177. Routing updates from non-routing neighbor gateways
  178.  
  179. A  routing  update  for  each  neighbor  gateway  that  does  not
  180. participate in this routing scheme.  This is the update that  the
  181. gateway  would  receive  from  this  neighbor if the neighbor did
  182. participate in routing.
  183.  
  184. Routing Table
  185.  
  186. A table containing, for each network,  a  list  of  the  neighbor
  187. gateways on a minimum length route to that network.
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.                               - 2 -
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. Send Sequence Number
  203.  
  204. The  sequence  number  that  the gateway will use to transmit the
  205. next routing update to its neighbors.
  206.  
  207. Receive Sequence Numbers
  208.  
  209. The sequence number that the gateway received in the last routing
  210. update from each of its neighbors.  There is  a  sequence  number
  211. for each neighbor.
  212.  
  213. 3.  Initialization
  214.  
  215. The gateway is initialized with the following information:
  216.  
  217. The gateway's address on each network to which it is attached.
  218.  
  219. The addresses of its neighbors.
  220.  
  221. A  routing  update from each of its neighbor gateways that do not
  222. participate in routing.
  223.  
  224. Initially, the  gateway  should  assume  that  all  its  neighbor
  225. gateways are down, that it is disconnected from networks to which
  226. it is attached, and that the distance reported in routing updates
  227. from  each  neighbor  to each network is infinity (see "Computing
  228. Routes").
  229.  
  230. 4.  Determining Connectivity to Networks
  231.  
  232. The gateway must determine its connectivity to networks to  which
  233. it is physically attached.  The gateway is connected to a network
  234. if  it  can send and receive internet packets on its interface to
  235. that network.  The method that the gateway uses to determine  its
  236. connectivity   to  a  network  is  network  dependent.   In  some
  237. networks, the host to network protocol determines whether or  not
  238. data  packets can be sent and received on the host interface.  In
  239. these networks, the gateway can simply check  status  information
  240. provided  by  the  protocol  in  order  to  determine  if  it can
  241. communicate with the network.  In other networks, where the  host
  242. to  network  protocols  are less complex, it may be necessary for
  243. the gateway to send traffic to itself  to  determine  if  it  can
  244. communicate  with  the  network.  In these networks, the gateways
  245. can periodically poll the network to  determine  if  the  network
  246. interface is operational.
  247.  
  248. For  purposes  of  computing distances and routes to networks, if
  249. the  gateway  can  send  and  receive  traffic  on  its   network
  250. interface, then its distance to the network is zero; if it cannot
  251. send  and  receive traffic on the interface, then its distance to
  252.  
  253.  
  254.                               - 3 -
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262. the network is  infinity.   Note  that  if  a  gateway's  network
  263. interface is not working, it may still be able to send traffic to
  264. the  network  on  an  alternate  route  via  one  of its neighbor
  265. gateways.
  266.  
  267. 5.  Determining Connectivity to Neighbors
  268.  
  269. A neighbor gateway is in one  of  three  states:   up,  down,  or
  270. recovering.   In  the  latter  case, the gateway has communicated
  271. with its neighbor, and  is  in  a  waiting  period  to  determine
  272. whether  it  will  be  able  to  continue to communicate with the
  273. neighbor.  This state exists to prevent a gateway  from  using  a
  274. neighbor  gateway  to forward traffic when communications between
  275. it and the neighbor are extremely lossy.  The gateway  determines
  276. its connectivity to each neighbor gateway as follows.  Initially,
  277. the  neighbor is assumed to be "down".  The gateway sends an echo
  278. packet (see "Packet Formats") to the  neighbor  gateway  every  N
  279. seconds  and  increments  a  count of echo packets outstanding to
  280. that neighbor.  When the gateway receives an  echo  reply  packet
  281. from  the  neighbor,  it  clears  the  count  of outstanding echo
  282. packets.  If that neighbor was "down", the gateway  starts  an  X
  283. second  timer and sets the neighbor's status to "recovering".  If
  284. after X seconds, the neighbor's  status  is  still  "recovering",
  285. then  the  neighbor's status is changed to "up".  If the count of
  286. echo packets outstanding  to  a  neighbor  is  equal  to  Z,  the
  287. neighbor's  status  is set to "down".  As probes are sent every N
  288. seconds, a neighbor's status is changed to "down" if it does  not
  289. respond within (N * Z) seconds.  Note that the waiting period, X,
  290. during  which  the neighbor's status is "recovering" should be at
  291. least several times the  interval  (N  *  Z  seconds)  needed  to
  292. declare  the neighbor "down".  This prevents the neighbor gateway
  293. from cycling rapidly between the "up" and "down" states.
  294.  
  295. The gateway maintains a vector of the connectivity between it and
  296. its neighbors.  This vector is used in  computing  distances  and
  297. routes to networks.  The vector contains K entries where K is the
  298. number  of neighbors.  If the state of the Jth neighbor is either
  299. "down" or "recovering", then the Jth entry of the vector  is  set
  300. to  infinity;  if  the state of the Jth neighbor is "up" then the
  301. Jth entry of the vector is set to one.
  302.  
  303. 6.  Exchanging Routing Information
  304.  
  305. The gateway receives and transmits routing  information  reliably
  306. using   sequence   numbered  packets  and  a  retransmission  and
  307. acknowledgement scheme.  This scheme works as follows.  For  each
  308. neighbor,  the  gateway remembers the Receive Sequence Number, R,
  309. that it received in the most  recent  routing  packet  from  that
  310. neighbor.   This  value  is  initialized  by  setting  it  to the
  311. sequence number received in the  first  routing  packet  received
  312.  
  313.  
  314.                               - 4 -
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322. from  a neighbor after that neighbor's status is set to "up".  On
  323. receipt  of  a  routing  packet  from  a  neighbor,  the  gateway
  324. subtracts  the  Receive  Sequence  Number,  R,  from the sequence
  325. number in the routing packet, S. If this value (S-R)  is  greater
  326. than  or  equal  to  zero,  then  the gateway accepts the routing
  327. packet, sends an acknowledgement to the neighbor  containing  the
  328. sequence  number  S, and replaces the Receive Sequence Number, R,
  329. with S.  If this value (S-R)  is  less  than  zero,  the  gateway
  330. rejects  the  routing packet and sends a negative acknowledgement
  331. to the neighbor with sequence number R.
  332.  
  333. The gateway has a Send Sequence Number, N,  for  sending  routing
  334. packets  to  all  of  its neighbors.  This sequence number can be
  335. initialized  to  any  value.   The  Send   Sequence   Number   is
  336. incremented  each  time  a  new  routing  update  is created.  On
  337. receiving an acknowledgement for a routing  update,  the  gateway
  338. subtracts  the  sequence  number  acknowledged,  A, from the Send
  339. Sequence Number, N.  If the value (N-A) is non-zero, then an  old
  340. routing  update  is being acknowledged.  The gateway continues to
  341. retransmit the most recent routing update to  the  neighbor  that
  342. sent  the  acknowledgement.  If (N-A) is zero, the routing update
  343. has been acknowledged.  Note that only the  most  recent  routing
  344. update  need  be  acknowledged;  if  a  second  routing update is
  345. generated before the first routing update is  acknowledged,  only
  346. the second routing update need be acknowledged.
  347.  
  348. If  a negative acknowledgement is received, the gateway subtracts
  349. the sequence number negatively acknowledged,  A,  from  its  Send
  350. Sequence  Number, N.  If this value (N-A) is less than zero, then
  351. the gateway replaces  its  Send  Sequence  Number,  N,  with  the
  352. sequence  number  negatively  acknowledged  plus  one,  A+1,  and
  353. retransmits the update to all its neighbors.  If (N-A) is greater
  354. than or equal to zero, then the gateway continues  to  retransmit
  355. the routing update using sequence number N.  In order to maintain
  356. the  correct  sequence  numbers  at all gateways, routing updates
  357. must be retransmitted to  all  neighbors  if  the  Send  Sequence
  358. Number  changes, even if the routing information does not change.
  359.  
  360. The gateway retransmits routing updates periodically  until  they
  361. are  acknowledged  and whenever its Send Sequence Number changes.
  362. The gateway sends routing updates only to neighbors that  are  in
  363. the "up" state, not to neighbors that are "down" or "recovering".
  364. Examples of the sequence number strategy are given below.
  365.  
  366. 7.  Computing Routes
  367.  
  368. A  routing  update contains the number of networks that a gateway
  369. is reporting about followed by a list of the distances  to  these
  370. networks,  indexed  by network number.  Assuming that the gateway
  371. has checked the sequence number of a routing update that  it  has
  372.  
  373.  
  374.                               - 5 -
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382. received and has decided to accept the update, the information in
  383. the update is processed as follows.
  384.  
  385. The  gateway  contains  a  N  x K distance matrix, where N is the
  386. number of networks and K is the number of neighbor gateways.   An
  387. entry  in  this matrix, represented as d(I,J), is the distance to
  388. network I from neighbor J as reported in the most recent  routing
  389. update  from  neighbor  J.   The  gateway  also contains a vector
  390. indicating the  connectivity  between  itself  and  its  neighbor
  391. gateways.   The  values  in this vector are computed as discussed
  392. above (see "Determining Connectivity to Neighbors").   The  value
  393. of  the  Jth  entry  of  this  vector,  which is the connectivity
  394. between the gateway and the Jth neighbor, is represented as d(J).
  395.  
  396. The gateway copies the  routing  update  received  from  the  Jth
  397. neighbor  into  the  appropriate row of the distance matrix, then
  398. updates its routes as follows.  The gateway calculates a  minimum
  399. distance  vector, containing the minimum distance to each network
  400. from the gateway.  The Ith entry of this vector,  represented  as
  401. MinD(I) is:
  402.  
  403.         MinD(I) = minimum over all neighbors of d(J) + d(I,J)
  404.  
  405. where  d(J)  is  the  distance  between  the  gateway and the Jth
  406. neighbor and d(I,J) is the distance from the Jth neighbor to  the
  407. Ith  network.   If the Ith network is attached to the gateway and
  408. the gateway can send and receive traffic on its network interface
  409. (see "Determining Connectivity to Networks"),  then  the  gateway
  410. sets the Ith entry of the minimum distance vector to zero.
  411.  
  412. Using the minimum distance vector, the gateway computes a list of
  413. neighbor  gateways through which to send traffic to each network.
  414. The entry for network I contains all neighbors such that:
  415.  
  416.         MinD(I) = d(J) + d(I,J)
  417.  
  418. In other words, the entry for network I  contains  all  neighbors
  419. such  that the distance from the gateway to the neighbor plus the
  420. distance from the neighbor to the network is equal to the minimum
  421. distance from the gateway to the network.
  422.  
  423. After updating its routes to the networks, the  gateway  computes
  424. the  new  routing updates to be sent to its neighbors as follows.
  425. For each neighbor, J, the gateway  constructs  a  routing  update
  426. which is a N entry vector where N is the number of networks.  The
  427. Jth entry of this vector is:
  428.  
  429.         MinD(I) if MinD(I) less than or equal to d(I,J)
  430.         infinity if MinD(I) greater than d(I,J)
  431.  
  432.  
  433.  
  434.                               - 6 -
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442. where  d(I,J)  is  the  distance from the Jth neighbor to the Ith
  443. network and MinD(I) is the minimum distance from the  gateway  to
  444. the  Ith  network.   In  other  words,  the  gateway  reports its
  445. distance to a network to a neighbor only if it is as close to  or
  446. closer to a network than its neighbor.
  447.  
  448. Finally,  the  gateway  must  determine  whether  it  should send
  449. routing updates to its neighbors.  The gateway maintains  a  copy
  450. of  the  most  recent routing updates that it sent to each of its
  451. neighbors.  The gateway computes the new routing updates to  send
  452. to  each  of  its neighbors.  If any of these routing updates are
  453. different than the preceding updates, then the gateway sends  new
  454. routing  updates to its neighbors.  If no routing information has
  455. changed since the last routing update was sent, then the  gateway
  456. does  not  need  to  send new routing updates.  The gateway sends
  457. routing updates only to neighbors that are currently in the  "up"
  458. state.
  459.  
  460. The  gateway  requests routing updates from neighbors that are in
  461. the "up" state, but have not yet sent a  routing  update  to  it.
  462. Routing  updates  are requested by setting the appropriate bit in
  463. the routing update being sent (see "Packet Formats").  Similarly,
  464. if a gateway receives a routing update from a neighbor  in  which
  465. the bit requesting a routing update is set, the gateway sends the
  466. neighbor the most recent routing update.
  467.  
  468. 8.  Forwarding Traffic
  469.  
  470. On  receipt of a packet to be forwarded, the gateway extracts the
  471. internet destination network  field  from  the  packet.   If  the
  472. gateway  is attached to the network, and its network interface is
  473. operational, then the gateway  simply  composes  the  appropriate
  474. local  network  header  for the destination network and sends the
  475. packet.
  476.  
  477. If the gateway is not connected to the network, then the  gateway
  478. checks  the list of the neighbors on the route to the destination
  479. network.  If there are no neighbors on the list, then the gateway
  480. drops the packet and sends the  internet  source  a  "destination
  481. unreachable" message (see "Communications with Hosts").
  482.  
  483. If  there are one or more neighbors on a route to the destination
  484. network, then the gateway  sends  the  packet  to  one  of  these
  485. neighbors.   If  there  is  more  than  one  neighbor,  then  the
  486. neighbors are used in a round robin fashion.
  487.  
  488. 9.  Non-Routing Gateways
  489.  
  490. Non-routing gateways are gateways that forward internet  traffic,
  491. but  that  do  not  participate in this routing scheme.  Whenever
  492.  
  493.  
  494.                               - 7 -
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502. possible,  traffic  is  forwarded  only  through  gateways   that
  503. participate  in  this  routing  scheme.  Non-routing gateways are
  504. used to forward traffic only if they provide the only route to  a
  505. network.   These  gateways  are  used  as  follows.   Consider  a
  506. gateway, G1.  The only non-routing gateways that it needs to know
  507. about are its neighbor gateways, as these are the  gateways  from
  508. which  it  would  normally  receive  routing  updates.   For each
  509. non-routing neighbor gateway of gateway G1, compute  the  routing
  510. update  that  would  be sent to G1 assuming that all gateways and
  511. network connections are operational.  These routing  updates  are
  512. assembled  in  G1.   The  gateway, G1, first computes its minimum
  513. distance vector  as  explained  above,  using  only  the  routing
  514. updates  from  neighbors  that  participate  in  routing.  If the
  515. minimum distance to any network is infinity, i.e. the network  is
  516. unreachable  via  any  of  the routing gateways, then the minimum
  517. distance to that network is re-computed using the routing  update
  518. compiled  for  the non-routing neighbor gateway.  For purposes of
  519. computing the minimum distance to a  network,  the  gateway,  G1,
  520. assumes that the distance between itself and the neighbor gateway
  521. is  zero.   After  computing  the  minimum  distance  vector, the
  522. gateway compiles the list of neighbor gateways through  which  to
  523. send  traffic  to  each  network and sends routing updates to its
  524. neighbors as  explained  above  (see  "Computing  Routes").   The
  525. gateway does not send routing updates to the non-routing neighbor
  526. gateways.
  527.  
  528. 10.  Adding New Neighbors and Networks
  529.  
  530. Gateways  dynamically add routing information about new neighbors
  531. and new networks to their tables.  The gateway maintains  a  list
  532. of   neighbor  gateway  addresses.   When  a  routing  update  is
  533. received, the gateway searches this list  of  addresses  for  the
  534. internet  source  address  of  the routing update packet.  If the
  535. internet source address of the routing update is not contained in
  536. the list of neighbor addresses, the gateway adds this address  to
  537. the  list of neighbor addresses.  The gateway accepts the routing
  538. update, sets the neighbor's  connectivity  status  to  "up",  and
  539. computes  new routes as explained above.  The gateway also begins
  540. polling this new neighbor to monitor its connectivity.  Note that
  541. this strategy requires that one gateway in each pair of  neighbor
  542. gateways  must  have  the  neighbor's  address  assembled  in its
  543. tables.  The newest gateway can  be  given  a  complete  list  of
  544. neighbors,  thus  avoiding the need to re-assemble older gateways
  545. when new gateways are installed.
  546.  
  547. Gateways  obtain  routing  information  about  new  networks   as
  548. follows.  The gateway maintains a count of the number of networks
  549. for  which  it currently contains routing information, N.  When a
  550. routing update is received, the gateway compares this  number  to
  551. the  number  of networks reported in the routing update, M.  If M
  552.  
  553.  
  554.                               - 8 -
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562. is greater than N, then the gateway updates the count of networks
  563. for which it maintains routing information  to  include  the  new
  564. networks.   Next,  the  gateway  expands  its  distance matrix to
  565. include the number of networks reported.  The distance matrix  is
  566. the  matrix  of  distances  to  networks  as  reported in routing
  567. updates from the neighbor gateways.  In expanding the matrix, the
  568. gateway assumes the distance to all  new  networks  is  infinity.
  569. After  expanding  the matrix, the gateway computes new routes and
  570. new routing updates as outlined above.
  571.  
  572. Note that expanding neighbor address tables and distance matrices
  573. may present an implementation problem.  In practice, these tables
  574. can be assembled to contain some maximum number of neighbors  and
  575. networks.   If  a  new  neighbor  cannot  be added to a gateway's
  576. tables, then routing updates or echo packets from  that  neighbor
  577. should be ignored.  The new neighbor will assume that the gateway
  578. is  down  and  will  not use it to forward traffic.  If a gateway
  579. cannot add a new network to its  routing  tables,  it  can  still
  580. accept  routing  updates  containing  information  about  the new
  581. network, but it will be  unable  to  route  traffic  to  the  new
  582. network.  The routing updates that it sends to its neighbors will
  583. not  contain  information  about  the  new  network.   Whenever a
  584. gateway receives a  routing  update  that  does  not  report  the
  585. distance  to  a  network,  the  gateway  should  assume  that the
  586. distance is infinity.
  587.  
  588. 11.  Communications with Hosts
  589.  
  590. The  gateway  sends  messages  to  internet  hosts   in   several
  591. situations:    when   the   gateway  cannot  reach  the  internet
  592. destination,  when  the  gateway  does  not  have  the  buffering
  593. capacity to forward a packet, and when the gateway can direct the
  594. host  to  send  traffic on a shorter route.  These situations are
  595. explained in more detail below.  The formats  for  messages  sent
  596. from  a  gateway  to  a  host  are  given  in the section "Packet
  597. Formats".
  598.  
  599. If, according to the information in the gateway's routing tables,
  600. the network specified in the  internet  destination  field  of  a
  601. packet  is  unreachable,  i.e.  the  distance  to  the network is
  602. infinity, the gateway sends a destination unreachable message  to
  603. the  internet  source  host  of the packet.  In addition, in some
  604. networks, the gateway may be able to determine  if  the  internet
  605. destination  host is unreachable.  Gateways in these networks may
  606. send destination unreachable messages to the source host when the
  607. destination host is unreachable.
  608.  
  609. The gateway may discard internet packets if it does not have  the
  610. buffer  space  needed to queue the packets for output to the next
  611. network on the route to the destination network.  If the  gateway
  612.  
  613.  
  614.                               - 9 -
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.  
  622. discards  a  packet,  it  sends  a  source  quench message to the
  623. internet source host of the packet.  The source quench message is
  624. a request to the host to cut back the rate at which it is sending
  625. traffic to the internet destination.  The gateway sends a  source
  626. quench message for every message that it discards.  On receipt of
  627. a  source quench message, hosts should cut back the rate at which
  628. they are sending traffic to the specified destination until  they
  629. no  longer  receive source quench messages from the gateway.  The
  630. hosts can then gradually increase the  rate  at  which  they  are
  631. sending  traffic  to  the  destination  until  they again receive
  632. source quench messages from the gateway.
  633.  
  634. The gateway sends a redirect message to a host in  the  following
  635. situation.   A  gateway,  G1,  receives an internet packet from a
  636. host on a network to which the gateway is attached.  The gateway,
  637. G1, checks its routing table and obtains the address of the  next
  638. gateway,  G2,  on  the route to the packet's internet destination
  639. network, X.  If G2 and the host identified by the internet source
  640. address of the packet are on the same network, a redirect message
  641. is sent to the host.  The redirect message advises  the  host  to
  642. send  its traffic for network X directly to gateway G2 as this is
  643. a shorter path to the  destination.   The  gateway  forwards  the
  644. original data packet to its internet destination.
  645.  
  646. 12.  Future Modifications
  647.  
  648. As  there  are  now  many networks planned or implemented, and as
  649. these networks may be assigned a wide range of  network  numbers,
  650. it  is  no  longer  feasible  to  maintain routing information in
  651. tables indexed by network numbers.  Gateways will be modified  to
  652. use  a  hash  table scheme to convert network numbers to internal
  653. indices to reference routing tables.  The information in  routing
  654. updates  exchanged  by  the gateways will no longer be indexed by
  655. network number.  The format of routing updates will  be  modified
  656. to  include  both  the  network  number  and  the distance to the
  657. network.  These modifications will be documented  in  a  separate
  658. note.
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674.                              - 10 -
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681.  
  682. 13.  Packet Formats
  683.  
  684. Gateway  to  gateway  and  gateway to host communications use the
  685. version 4 internet protocol.  The first octet of the data portion
  686. of the packet is a gateway type field; the value  of  this  field
  687. determines  the  format  of  the  remaining  data.  The format of
  688. internet packets is explained in IEN #111,  "Internet  Protocol".
  689. Unless  otherwise noted under the individual format descriptions,
  690. the values of the internet header fields are as follows:
  691.  
  692. Version                 4
  693.  
  694. IHL                     Internet header length in 32-bit words;
  695.                         this is 5.
  696.  
  697. Type of Service         0
  698.  
  699. Total Length            Length of internet header and data in
  700.                         octets.
  701.  
  702. Identification, Flags,
  703. Fragment Offset         Used in fragmentation, see IEN #111.
  704.  
  705. Time to Live            Time to live in seconds; as this field
  706.                         is decremented at each machine in which
  707.                         the packet is processed, the value in
  708.                         this field should be at least as great as
  709.                         the number of gateways which this packet
  710.                         will traverse.  (This must be considered
  711.                         in the messages sent to hosts.)
  712.  
  713. Protocol                3
  714.  
  715. Header Checksum         The 16 bit one's complement of the one's
  716.                         complement sum of all 16 bit words in the
  717.                         header.  For computing the checksum, the
  718.                         checksum field should be zero.  This
  719.                         checksum may be replaced in the future,
  720.                         see updates of the Internet Protocol
  721.                         Specification.
  722.  
  723. Source Address          The address of the gateway that composes
  724.                         the packet.  Unless otherwise noted, this
  725.                         can be any of the gateway's addresses.
  726.  
  727. Destination Address     The address of the gateway or host to
  728.                         which the packet should be sent.
  729.  
  730.  
  731.  
  732.  
  733.  
  734.                              - 11 -
  735.  
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742.                          Routing Update
  743.  
  744.  0                   1                   2                   3
  745.  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  746. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  747. ! Gateway Type  !    unused     !         Sequence Number       !
  748. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  749. ! NU !     N    !  Distance 1   !  Distance 2   !  Distance 3   !
  750. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  751.                                 .
  752.                                 .
  753.                                 .
  754. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  755. !  Distance N-3 !  Distance N-2 !  Distance N-1 !  Distance N   !
  756. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  757.  
  758. Gateway Type            1
  759.  
  760. Sequence Number         The 16-bit sequence number used to transmit
  761.                         routing updates.
  762.  
  763. NU                      A 1-bit field.  This bit is set if the
  764.                         source gateway requests a routing update
  765.                         from the destination gateway.
  766.  
  767. N                       The number of networks for which distances
  768.                         are reported in this update.
  769.  
  770. Distance 1..N           A set of octets that are the values in
  771.                         the routing update for distances to
  772.                         network numbers 1 through N.  The network
  773.                         numbers are listed in IEN #117, "Assigned
  774.                         Numbers".  If the Ith network is unreachable,
  775.                         the distance to the network is infinity,
  776.                         which is represented as 177 (octal).
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.                              - 12 -
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  
  801.  
  802.            Acknowledgement or Negative Acknowledgement
  803.  
  804.  0                   1                   2                   3
  805.  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  806. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  807. ! Gateway Type  !    unused     !         Sequence Number       !
  808. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  809.  
  810. Gateway Type            2 for acknowledgement; 10 (decimal) for
  811.                         negative acknowledgement.
  812.  
  813. Sequence Number         The 16-bit sequence number that the gateway
  814.                         is acknowledging or negatively acknowledging.
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.                              - 13 -
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.                  Destination Unreachable Packet
  863.  
  864.  0                   1                   2                   3
  865.  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  866. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  867. ! Gateway Type  !     Code      !           unused              !
  868. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  869. !      Internet Header + 64 bits of Original Data Packet        !
  870. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  871.  
  872. Destination Address     The source network and address from the
  873.                         original data packet.
  874.  
  875. Gateway Type            3
  876.  
  877. Code                    0 = net unreachable; 1 = host unreachable.
  878.  
  879. Internet Header + 64 bits
  880. of Data Packet          The internet header plus the first 64 bits
  881.                         of the original data packet.  This data is
  882.                         used by the host to match the message from
  883.                         the gateway to the appropriate process.
  884.                         If a higher level protocol uses port numbers,
  885.                         they are assumed to be in the first 64 data
  886.                         bits of the original data packet.
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.                              - 14 -
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.                       Source Quench Packet
  923.  
  924.  0                   1                   2                   3
  925.  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  926. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  927. ! Gateway Type  !                 unused                        !
  928. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  929. !      Internet Header + 64 bits of Original Data Packet        !
  930. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  931.  
  932. Destination Address     The source network and address of the
  933.                         original data packet.
  934.  
  935. Gateway Type            4
  936.  
  937. Internet Header + 64 bits
  938. of Data Packet          The internet header plus the first 64 bits
  939.                         of the original data packet.  This data is
  940.                         used by the host to match the message from
  941.                         the gateway to the appropriate process.
  942.                         If a higher level protocol uses port numbers,
  943.                         they are assumed to be in the first 64 data
  944.                         bits of the original data packet.
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.                              - 15 -
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.                          Redirect Packet
  983.  
  984.  0                   1                   2                   3
  985.  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  986. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  987. ! Gateway Type  !                 unused                        !
  988. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  989. !Gateway Network!           Gateway Address                     !
  990. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  991. !      Internet Header + 64 bits of Original Data Packet        !
  992. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  993.  
  994. Destination Address     The source network and address of the
  995.                         original data packet.
  996.  
  997. Gateway Type            5
  998.  
  999. Gateway Network         Address of the gateway to which traffic
  1000. Gateway Address         for the network specified in the
  1001.                         internet destination network field of
  1002.                         the data packet should be sent.
  1003.  
  1004. Internet Header + 64 bits
  1005. of Data Packet          The internet header plus the first 64 bits
  1006.                         of the original data packet.  This data is
  1007.                         used by the host to match the message from
  1008.                         the gateway to the appropriate process.
  1009.                         If a higher level protocol uses port numbers,
  1010.                         they are assumed to be in the first 64 data
  1011.                         bits of the original data packet.
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.                              - 16 -
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.                     Echo or Echo Reply Packet
  1043.  
  1044.  0                   1                   2                   3
  1045.  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  1046. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1047. ! Gateway Type  !                  unused                       !
  1048. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1049.  
  1050. Source Address          In an echo packet, the address of the
  1051.                         gateway on the same network as the neighbor
  1052.                         to which it is sending the echo packet.
  1053.                         In an echo reply packet, the source and
  1054.                         destination addresses are simply reversed.
  1055.  
  1056. Gateway Type            8 for echo packet; 0 for echo reply.
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.  
  1064.  
  1065.  
  1066.  
  1067.  
  1068.  
  1069.  
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080.  
  1081.  
  1082.  
  1083.  
  1084.  
  1085.  
  1086.  
  1087.  
  1088.  
  1089.  
  1090.  
  1091.  
  1092.  
  1093.  
  1094.                              - 17 -
  1095.  
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101.  
  1102.                    Net Interface Status Packet
  1103.  
  1104.  0                   1                   2                   3
  1105.  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  1106. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1107. ! Gateway Type  !                  unused                       !
  1108. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1109.  
  1110. Source Address
  1111. Destination Address     The address of the gateway's network
  1112.                         interface.  The gateway can send Net
  1113.                         Interface Status Packets to itself to
  1114.                         determine if it is able to send and
  1115.                         receive traffic on its network interface.
  1116.  
  1117.  
  1118. Gateway Type            9
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154.                              - 18 -
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162. 14.  Examples
  1163.  
  1164. The following examples illustrate the sequence number scheme
  1165. used for sending and receiving routing updates.
  1166.  
  1167. Example 1:
  1168.  
  1169. Gateway G has three neighbors:  A, B and C.
  1170. Gateway G's Send Sequence Number is 5.
  1171. Connectivity between gateway G and gateway A was broken and is
  1172. now restored; thus, A has not received the last update from G.
  1173. Gateway A's Receive Sequence Number for G is 3.
  1174. Gateway B's Receive Sequence Number for G is 4.
  1175. Gateway C's Receive Sequence Number for G is 4.
  1176.  
  1177. Initially, gateway G has the following values in its tables:
  1178.  
  1179. Send Sequence   Received Acknowledgement from Neighbors
  1180.                    A   B   C
  1181.      5             N   N   N  (N for no, Y for yes)
  1182.  
  1183.  
  1184. G (5) ---> A       G sends routing update 5 to its neighbors
  1185. G (5) ---> B
  1186. G (5) ---> C
  1187. A (ACK 5) ---> G   A computes (sequence number received in
  1188.                    packet - Receive Sequence Number) = (5-3); as
  1189.                    this is greater than or equal to zero, A
  1190.                    acknowledges routing update 5 and replaces
  1191.                    Receive Sequence Number for G with 5
  1192.  
  1193. B (ACK 5) ---> G   B computes (sequence number received in
  1194.                    packet - Receive Sequence Number) = (5-4); as
  1195.                    this is greater than or equal to zero, B
  1196.                    acknowledges routing update 5 and replaces
  1197.                    its Receive Sequence Number for G with 5
  1198.  
  1199. C (ACK 5) ---> G
  1200.  
  1201. On receipt of these acknowledgements, G computes (Send Sequence
  1202. Number - sequence number acknowledged) = (5-5).  As this value
  1203. is zero, G notes that each of its neighbors has acknowledged
  1204. its routing update.
  1205.  
  1206.  
  1207.  
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.                              - 19 -
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222. Gateway G now has the following values in its tables:
  1223.  
  1224. Send Sequence   Received Acknowledgement from Neighbors
  1225.                    A   B   C
  1226.      5             Y   Y   Y
  1227.  
  1228. Gateway A's Receive Sequence Number for G is 5.
  1229. Gateway B's Receive Sequence Number for G is 5.
  1230. Gateway C's Receive Sequence Number for G is 5.
  1231.  
  1232.  
  1233.  
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.  
  1262.  
  1263.  
  1264.  
  1265.  
  1266.  
  1267.  
  1268.  
  1269.  
  1270.  
  1271.  
  1272.  
  1273.  
  1274.                              - 20 -
  1275.  
  1276.  
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282. Example 2:
  1283.  
  1284. Gateway G has three neighbors:  A, B, and C.
  1285. Gateway G's Send Sequence Number is 24.
  1286. Gateway A has been disconnected from gateway G for some long time,
  1287. thus, it has missed many updates from G and G's Send Sequence Number
  1288. has now wrapped around.
  1289. Gateway A's Receive Sequence Number for G is 500.
  1290. Gateway B's Receive Sequence Number for G is 23.
  1291. Gateway C's Receive Sequence Number for G is 23.
  1292.  
  1293. Initially, gateway G has the following values in its tables:
  1294.  
  1295. Send Sequence   Received Acknowledgement from Neighbors
  1296.                    A   B   C
  1297.      24            N   N   N  (N for no, Y for yes)
  1298.  
  1299. G (24) ---> A       G sends routing update 24 to all its neighbors
  1300. G (24) ---> B
  1301. G (24) ---> C
  1302. A (NAK 500) ---> G  A computes (sequence number received in
  1303.                     packet - Receive Sequence Number) = (24-500);
  1304.                     as this is less than zero, A sends a negative
  1305.                     acknowledgement with sequence number 500
  1306.  
  1307. On receipt of the negative acknowledgement, gateway G computes
  1308. (Send Sequence Number - sequence number negatively acknowledged)
  1309. = (24-500).  As this value is less than zero, G replaces its Send
  1310. Sequence Number with 501 and retransmits the routing update with
  1311. this sequence number.
  1312.  
  1313. G (501) ---> A
  1314. G (501) ---> B
  1315. G (501) ---> C
  1316. A (ACK 501) ---> G  A computes (sequence number received in
  1317.                     packet - Receive Sequence Number) = (501-500);
  1318.                     as this is greater than or equal to zero,
  1319.                     A acknowledges sequence number 501 and
  1320.                     replaces its Receive Sequence Number for G
  1321.                     with 501
  1322.  
  1323. B (ACK 24) ---> G   B receives the update from G with sequence
  1324.                     number 24; B computes (sequence number received
  1325.                     in packet - Receive Sequence Number) = (24-23);
  1326.                     as this is greater than or equal to zero,
  1327.                     B acknowledges sequence number 24 and replaces
  1328.                     its Receive Sequence Number for G with 24
  1329.  
  1330. C (ACK 24) ---> G
  1331.  
  1332.  
  1333.  
  1334.                              - 21 -
  1335.  
  1336.  
  1337.  
  1338.  
  1339.  
  1340.  
  1341.  
  1342. On receipt of these acknowledgements, G computes (Send Sequence
  1343. Number - sequence number acknowledged) = (501-24).  As this value
  1344. is non-zero, G retransmits the routing update to these neighbors.
  1345.  
  1346. G (501) ---> B
  1347. G (501) ---> C
  1348. B (ACK 501) ---> G  B computes (sequence number received in
  1349.                     packet - Receive Sequence Number) = (501-24);
  1350.                     as this is greater than or equal to zero,
  1351.                     B acknowledges sequence number 501 and
  1352.                     replaces its Receive Sequence Number for G
  1353.                     with 501
  1354.  
  1355.  
  1356. C (ACK 501) ---> G
  1357.  
  1358. On receipt of these acknowledgements, G computes (Send Sequence
  1359. Number - sequence number acknowledged) = (501-501).  As this value
  1360. is zero, G notes that each of its neighbors has acknowledged
  1361. its routing update.
  1362.  
  1363. Gateway G now has the following values in its tables:
  1364.  
  1365. Send Sequence   Received Acknowledgement from Neighbors
  1366.                    A   B   C
  1367.      501           Y   Y   Y
  1368.  
  1369. Gateway A's Receive Sequence Number for G is 501.
  1370. Gateway B's Receive Sequence Number for G is 501.
  1371. Gateway C's Receive Sequence Number for G is 501.
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.                              - 22 -
  1395.  
  1396.  
  1397.  
  1398.  
  1399.  
  1400.  
  1401.  
  1402. 15.  Tables and Variables
  1403.  
  1404. The following is a list of variables  and  tables  in  a  typical
  1405. gateway implementation.
  1406.  
  1407. 1.  Number of Networks
  1408.  
  1409. 2.  Number of Neighbors
  1410.  
  1411. 3.  Gateway Addresses
  1412.  
  1413. The addresses of the gateway's network interfaces.
  1414.  
  1415. 4.  Neighbor Gateway Addresses
  1416.  
  1417. The address of each gateway network interface that is on the same
  1418. network as this gateway.
  1419.  
  1420. 5.  Neighbor Connectivity Vector
  1421.  
  1422. A vector of the connectivity between this gateway and each of its
  1423. neighbors.   It  contains  K  entries  where  K  is the Number of
  1424. Neighbors.  Values in this vector are computed  as  explained  in
  1425. "Determining Connectivity to Neighbors".
  1426.  
  1427. 6.  Distance Matrix
  1428.  
  1429. A  matrix  of  the  routing  updates  received  from the neighbor
  1430. gateways.
  1431.  
  1432. 7.  Minimum Distance Vector
  1433.  
  1434. A vector containing the minimum distance to each network.  It  is
  1435. computed as described in "Computing Routes".
  1436.  
  1437. 8.  Routing Updates
  1438.  
  1439. A  set  of  vectors giving the distance from this gateway to each
  1440. network.  There is a separate vector to be sent to each neighbor.
  1441. These are computed as described in "Computing Routes".
  1442.  
  1443. 9.  Routing Updates from Non-Routing Gateways
  1444.  
  1445. The routing updates that  would  have  been  received  from  each
  1446. neighbor  gateway  that  does  not  participate  in  this routing
  1447. strategy.   These  are  computed  as  described  in  "Non-Routing
  1448. Gateways".
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.                              - 23 -
  1455.  
  1456.  
  1457.  
  1458.  
  1459.  
  1460.  
  1461.  
  1462. 10.  Routing Table
  1463.  
  1464. A  table  containing,  for  each  network, a list of the neighbor
  1465. gateways on a minimum distance route to  the  network.   This  is
  1466. computed as described in "Computing Routes".
  1467.  
  1468. 11.  Send Sequence Number
  1469.  
  1470. The  sequence  number  that will be used to send the next routing
  1471. update.
  1472.  
  1473. 12.  Receive Sequence Numbers
  1474.  
  1475. The sequence numbers  that  the  gateway  received  in  the  last
  1476. routing update from each of its neighbors.
  1477.  
  1478. 13.  Received Acknowledgement Vector
  1479.  
  1480. A vector indicating whether or not each neighbor has acknowledged
  1481. the sequence number in the most recent routing update sent.
  1482.  
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.                              - 24 -
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522. 16.  Events and Responses
  1523.  
  1524. The following is a list of the events that occur at a gateway and
  1525. the  gateway's  responses.   The variables and tables referred to
  1526. are listed above.  This is a general guide for an implementation;
  1527. see  the  sections  above  for  the  details   of   the   various
  1528. computations.
  1529.  
  1530. 1.   Connectivity  to  a network to which the gateway is attached
  1531. changes.
  1532.  
  1533.         1.  Update the Minimum Distance Vector.
  1534.  
  1535.         2.  Recompute the Routing Updates.
  1536.  
  1537.         3.  Recompute the Routing Table.
  1538.  
  1539.         4.  If any routing  update  has  changed,  send  the  new
  1540.         routing updates to the neighbors.
  1541.  
  1542. 2.  Connectivity to a neighbor gateway changes.
  1543.  
  1544.         1.  Update the Neighbor Connectivity Vector.
  1545.  
  1546.         2.  Recompute the Minimum Distance Vector.
  1547.  
  1548.         3.  Recompute the Routing Updates.
  1549.  
  1550.         4.  Recompute the Routing Table.
  1551.  
  1552.         5.   If  any  routing  update  has  changed, send the new
  1553.         routing updates to the neighbors.
  1554.  
  1555.  
  1556. 3.  A Routing Update Packet is received.
  1557.  
  1558.         1.  Compare the internet source address  of  the  Routing
  1559.         Update  Packet to the Neighbor Addresses.  If the address
  1560.         is not on the list,  add  it  to  the  list  of  Neighbor
  1561.         Addresses, increment the Number of Neighbors, and set the
  1562.         Receive Sequence Number for this neighbor to the sequence
  1563.         number in the Routing Update Packet.
  1564.  
  1565.         2.  Compare the Receive Sequence Number for this neighbor
  1566.         to  the  sequence  number in the Routing Update Packet to
  1567.         determine whether or not to accept this packet.   If  the
  1568.         packet  is  rejected,  send  a  Negative  Acknowledgement
  1569.         Packet.    If   the   packet   is   accepted,   send   an
  1570.         Acknowledgement  Packet  and  proceed  with the following
  1571.         steps.
  1572.  
  1573.  
  1574.                              - 25 -
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.         3.  Compare the number of networks  reported  on  in  the
  1583.         Routing  Update Packet to the Number of Networks.  If the
  1584.         number of networks in the  packet  is  greater  than  the
  1585.         Number  of Networks, then replace Number of Networks with
  1586.         the  number  of  networks  in  the  packet.   Expand  the
  1587.         Distance Matrix to account for the new networks.
  1588.  
  1589.         4.  Copy the routing update received into the appropriate
  1590.         row of the Distance Matrix.
  1591.  
  1592.         5.  Recompute the Minimum Distance Vector.
  1593.  
  1594.         6.  Recompute the Routing Updates.
  1595.  
  1596.         7.  Recompute the Routing Table.
  1597.  
  1598.         8.   If  any  routing  update  has  changed, send the new
  1599.         routing updates to the neighbors.
  1600.  
  1601. 4.  An Acknowledgement  or  Negative  Acknowledgement  Packet  is
  1602. received.
  1603.  
  1604.         1.  Compare the sequence number in the packet to the Send
  1605.         Sequence Number.  If necessary, replace the Send Sequence
  1606.         Number,  and retransmit the routing updates.  If the Send
  1607.         Sequence Number is acknowledged, update the entry in  the
  1608.         Received Acknowledgment Vector for the neighbor that sent
  1609.         the acknowledgement.
  1610.  
  1611. 5.  A data packet is received.
  1612.  
  1613.         1.   Forward the data packet using the information in the
  1614.         Routing Table entry for the packet's destination network.
  1615.  
  1616.         2.  If the destination is unreachable, send a Destination
  1617.         Unreachable Packet to the internet  source  of  the  data
  1618.         packet.
  1619.  
  1620.         3.   If the data packet is discarded because there are no
  1621.         buffers available in the  gateway,  then  send  a  Source
  1622.         Quench  Packet to the internet source of the data packet.
  1623.  
  1624.         4.  If the gateway to which  the  data  packet  is  being
  1625.         forwarded  and  the  data packet's internet source are on
  1626.         the same network, send a Redirect Packet to the  internet
  1627.         source of the data packet.
  1628.  
  1629.  
  1630.  
  1631.  
  1632.  
  1633.  
  1634.                              - 26 -
  1635.  
  1636.  
  1637.